import tkinter as tk
import time
import pyautogui
from set import *
from daily_task import *
import os


class TKWindow:
    def __init__(self, master):
        self.master = master
        self.master.title("三国杀小助手")
        self.master.geometry("400x300")

        # 创建一个变量来存储单选按钮的值
        self.selected_option = tk.StringVar()

        # 创建单选按钮
        self.radiobutton1 = tk.Radiobutton(self.master, text="启动三国杀", variable=self.selected_option,
                                           value="启动")
        self.radiobutton1.pack()

        self.radiobutton2 = tk.Radiobutton(self.master, text="循环刷演练场（在主界面）", variable=self.selected_option,
                                           value="循环刷演练场")
        self.radiobutton2.pack()

        self.radiobutton3 = tk.Radiobutton(self.master, text="开始执行日常任务（在主界面）", variable=self.selected_option,
                                           value="开始执行日常任务")
        self.radiobutton3.pack()

        # 创建启动按钮
        self.button = tk.Button(self.master, text="启动", command=self.start_activity)
        self.button.pack(side="left", fill="x", expand=False)




    def start_activity(self):
        # 这里可以根据 self.selected_option 的值来执行不同的操作
        option = self.selected_option.get()
        if option == "启动":
            os.startfile("D:\模拟器\LDPlayer4\dnplayer.exe")
            time.sleep(15)#等待模拟器启动
            daily_task()#进入界面
            # quit("完成任务")
        elif option == "循环刷演练场":
            print("循环刷演练场开始")
            fight(10)
        elif option == "开始执行日常任务":
            notice("启动日常活动")
            daily_task_start(True,True)#回答问题，领取元宝
            time.sleep(5)
            tehui()#签到
            time.sleep(5)
            daily_task_get()
            quit("日常任务完成")


# 创建一个tkinter窗口对象
root = tk.Tk()
# 创建一个tkinter窗口类对象
window = TKWindow(root)
# 进入主循环
root.mainloop()
